<template>
	<div class="quill">
		<quill-editor ref="myTextEditor"
					  v-model="getContent"
					  @input="updateMessage"
					  :config="editorOption">
		</quill-editor>
	</div>
</template>

<script>
	import { quillEditor } from 'vue-quill-editor'
    import { mapGetters } from 'vuex'
    import { mapActions } from 'vuex'

    export default {
        data () {
            return {
                content: '',
                editorOption: {}
            };
        },
        computed: {
            // 使用对象展开运算符将 getters 混入 computed 对象中
            ...mapGetters([
                'getContent'
                // ...
            ])
        },
        components: {
            quillEditor
        },
        methods: {
            ...mapActions([
                'changeContent'
            ]),
            updateMessage (e) {
                this.$store.commit('changeContent', e)
            }
        }
    }

</script>

<style>

</style>